﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Server_Monitor.Forms
{
    public partial class Parent : Form
    {
        private Servers _Server;
        private Monitor _Monitor;
        private Servers GetServer()
        {
            if (_Server == null || _Server.IsDisposed)
            {
                _Server = new Servers();
                _Server.MdiParent = this;
            }
            return _Server;
        }
        private Monitor GetMonitor()
        {
            if (_Monitor == null || _Monitor.IsDisposed)
            {
                _Monitor = new Monitor();
                _Monitor.MdiParent = this;
            }
            return _Monitor;
        }
        public Parent()
        {
            InitializeComponent();
        }
        private void configureToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GetServer().Show();
        }

        private void Parent_Load(object sender, EventArgs e)
        {
        }

        private void monitorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GetMonitor().Show();
        }
    }
}
